set more off

use dataset, clear

gen othervoteshare = nadervotes/totalvotes*100 if year == 2000 | year == 2004
replace othervoteshare = perotvotes/totalvotes*100 if year == 1992 | year == 1996

gen dother = othervoteshare - l4.othervoteshare
gen lother = l4.othervoteshare

keep if !mi(dother) & year != 2000

gen ddemalt3 = demvotesharealt3 - lagdemvotesharealt3

foreach t in 1996 2004 {

	if `t' == 1996 local mycand Perot
	if `t' == 2004 local mycand Nader
	local t0 = `t' - 4

	#delimit;

	gr tw
		(sc ddemalt3 dother if year == `t', col(black) msize(tiny))
		,
			plotregion(style(none))
			ylab(, angle(horiz))
			ytitle("Change in Democratic vote, `t0'-`t'")
			xtitle("Change in `mycand' vote, `t0'-`t'")
			title(`t')
			;
			
	#delimit cr
	
	gr export "figure A6 `t'.eps", replace
		
}
